import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        DormitorySystem system = new DormitorySystem();  // 创建宿舍系统对象
        RoomManager roomManager = new RoomManager(system); // 房间管理对象
        StudentManager studentManager = new StudentManager(system); // 学生管理对象
        DataExporter dataExporter = new DataExporter(system); // 数据导出对象

        while (true) {
            System.out.println("\n1. 添加房间");
            System.out.println("2. 分配学生入住");
            System.out.println("3. 查看房间信息");
            System.out.println("4. 导出住宿信息");
            System.out.println("5. 退出");

            int choice = scanner.nextInt();  // 读取用户选择

            if (choice == 1) {
                roomManager.addRoom();
            } else if (choice == 2) {
                studentManager.assignStudentToRoom();
            } else if (choice == 3) {
                roomManager.viewRoomInfo();
            } else if (choice == 4) {
                dataExporter.exportData();
            } else if (choice == 5) {
                System.out.println("退出程序");
                break;
            } else {
                System.out.println("无效选择");
            }
        }
        scanner.close();
    }
}
